package Demo13;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 洪汤泽大帅哥
 * Date: 2024-12-21
 * Time: 15:46
 */
/* 请在这里填写答案 */
interface Phone{
    void dial ();
    void location();
    void photo();
    void music();
    void video();
}
class PhoneAdapter implements Phone{

    @Override
    public void dial() {

    }

    @Override
    public void location() {

    }

    @Override
    public void photo() {

    }

    @Override
    public void music() {

    }

    @Override
    public void video() {

    }
}
class OldPhone extends PhoneAdapter{
    @Override
    public void dial() {
        System.out.println("老人机拨打电话。");
    }

    @Override
    public void location() {
        System.out.println("老人机定位。");
    }
}
class HuawPhone extends PhoneAdapter{
    public void photo() {
        System.out.println("华为手机拍照。");
    }

    @Override
    public void dial() {
        System.out.println("华为手机拨打电话。");
    }

    @Override
    public void music() {
        System.out.println("华为手机播放音乐。");
    }

    @Override
    public void video() {
        System.out.println("华为手机播放视频。");
    }
}
public class Main{
    public static void main(String[] args) {
        print(new OldPhone());
        print(new HuawPhone());
    }
    public static void print(Phone p) {
        p.dial();
        p.location();
        p.photo();
        p.music();
        p.video();
    }
}